#!/bin/bash

# Visual Localization HTTP Server Startup Script
# This script starts the visual localization HTTP server with the specified parameters

# ============================================================================
# Configuration
# ============================================================================

RECONSTRUCTION_PATH="/media/sdisk/vis_loc/220kv/outputs/sfm_superpoint+superglue/"
DB_GLOBAL_FEATURES="/media/sdisk/vis_loc/220kv/outputs/global-feats-netvlad.h5"
DB_LOCAL_FEATURES="/media/sdisk/vis_loc/220kv/outputs/feats-superpoint-n4096-r1024.h5"
TOP_K=10

# HTTP server port
PORT=8049

# HTTP server host (0.0.0.0 for all interfaces, 127.0.0.1 for localhost only)
HOST="0.0.0.0"

# ============================================================================
# Start Server
# ============================================================================

echo "Starting Visual Localization HTTP Server..."
echo ""

python3 main.py \
    --reconstruction_path "$RECONSTRUCTION_PATH" \
    --db_global_features "$DB_GLOBAL_FEATURES" \
    --db_local_features "$DB_LOCAL_FEATURES" \
    --top_k $TOP_K \
    --port $PORT \
    --host "$HOST"

